<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/share/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JTROOM | 角色列表</title>
<%@ include file="/WEB-INF/views/share/meta.jsp"%>
<script type="text/javascript">
$(function(){
	$('#roleList').datagrid({  
	    columns:[[  
			{field:'ck',checkbox:true},
			{field:'rolename', title:'角色名称', width:100, align:'center'},
			{field:'description', title:'角色描述', width:100, align:'center'},
			{field:'createDate', title:'创建日期', width:100, align:'center'}
	    ]]
	}); 
	//验证表单
	$("#rolename").validatebox({
		required : true,
		validType : "length[1, 16]"
	});
	$("#description").validatebox({
		validType : "length[0, 100]"
	});
});

function search(value,name){
	$("#roleList").datagrid("load", {
		rolename : value
	});
}
</script>
</head>
<body>
	<table id="roleList" style="height: auto;width: auto;" title="角色列表" url="${base}/control/role/list" 
		 loadMsg="正在加载数据，请稍后......" pagination="true" rownumbers="true" fitColumns="true" striped ="true" nowrap="false"
		 pageList="[1,5,10,15,20,25,30,35,40,45,50]" toolbar="#toolbar" >
	</table>
	
	<div id="toolbar">
        <a href="javascript:void(0)" iconcls="icon-add" onclick="add('form', 'dialog', '添加角色', '${base}/control/role/save', 'submitid', 'roleList');" class="easyui-linkbutton" plain="true">添加</a> 
        <a href="javascript:void(0)" iconcls="icon-edit" class="easyui-linkbutton" onclick="updateUI('roleList', '${base}/control/role/updateui/', 'rolename', 'form', 'dialog', '编辑角色', 'submitid', '${base}/control/role/update/');" plain="true">修改</a> 
        <a href="javascript:void(0)"  class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="move('roleList', '${base}/control/role/delete/', 'rolename');">删除</a>
        <input id="searchbox" name="seachparam" style="width:150px" class="easyui-searchbox" data-options="searcher:search,prompt:'请输入要查询的值'"/>
    </div>
	
	<div id="dialog" class="easyui-dialog" style="width: 500px;height: 220px" closed="true" modal="true" data-options="buttons:'#submitButton'">
		<form id="form" action="" method="post" class="easyui-form">
			<table align="left">
				<tr>
					<td>角色名称：</td>
					<td>
						<input id="rolename" type="text" name="rolename"/>
					</td>
				</tr>
				<tr>
					<td valign="top">角色描述：</td>
					<td>
						<textarea id="description" rows="5" cols="30" name="description"></textarea>
					</td>
				</tr>
			</table>
		</form>
	</div>
	
	<div id="submitButton">
		<a href="javascript:void(0)" class="easyui-linkbutton" size="large" style="width: 80px;" id="submitid">提交</a>
	</div>
	
</body>
</noframes>

</html>
